Step 3 - Fine-tune the bloom effect

In this step you fine-tune the bloom effect by reapplying it three times. To make the effect spread to a wider area and look more realistic, you adjust the settings of the blur and the intensity of the bloom in each pass.

To fine-tune the bloom effect:

  1. Create three more passes of the bloom effect:
    1. In the Library hold down the Ctrl key, select the Horizontal Bloom 1 and Vertical Bloom 1 render passes, duplicate them, and rename the new render passes to Horizontal Bloom 2 and Vertical Bloom 2.
    2. Repeat the previous step twice but rename the render passes to:
      • Horizontal Bloom 3 and Vertical Bloom 3
      • Horizontal Bloom 4 and Vertical Bloom 4
    3. In the Library select the Blit Combined Bloom render pass and in the Properties add and set:
      • Texture1 to Vertical Bloom 2
      • Texture2 to Vertical Bloom 3
      • Texture3 to Vertical Bloom 4
      This way you set the render pass to render the Vertical Bloom 1, Vertical Bloom 2, Vertical Bloom 3, and Vertical Bloom 4 render passes using the CombineMaterial.
  2. Load the GaussianBloom09.kzmat material type from <KanziWorkspace>/Tutorials/Bloom/Assets.
    The GaussianBloom09Material material provides a directional Gaussian blur effect using a kernel size of 9 pixels. To optimize performance you use smaller kernel sizes when possible.
  3. Adjust the spread and intensity of the bloom effect:
    1. For each Composition Target Render Pass you created earlier in this procedure set the Resolution Divisor property to the value listed in this table:

      Composition Target Render PassResolution Divisor
      Horizontal Bloom 24
      Vertical Bloom 24
      Horizontal Bloom 38
      Vertical Bloom 38
      Horizontal Bloom 416
      Vertical Bloom 416
        
      This way you reduce the resolution of the composition target at every pass of the bloom effect, making the effect spread to a wider area.
    2. For each Blit Render Pass you created earlier in this procedure set the properties to the values listed in this table:

      Blit Render PassTexture0MaterialBlur Direction XBlur Direction YBlur RadiusIntensity
      Horizontal Bloom 2
      > Blit Horizontal Bloom
      Vertical Bloom 1GaussianBloom09Material103,331,5
      Vertical Bloom 2
      > Blit Vertical Bloom
      Horizontal Bloom 2GaussianBloom09Material00,53,331,5
      Horizontal Bloom 3
      > Blit Horizontal Bloom
      Vertical Bloom 2GaussianBloom09Material1051,33
      Vertical Bloom 3
      > Blit Vertical Bloom
      Horizontal Bloom 3GaussianBloom09Material00,551,33
      Horizontal Bloom 4
      > Blit Horizontal Bloom
      Vertical Bloom 3GaussianBloom09Material10103
      Vertical Bloom 4
      > Blit Vertical Bloom
      Horizontal Bloom 4GaussianBloom09Material00,5103
             
    3. In the Library select the Blit Combined Bloom render pass, and in the Properties add and set:
      • Pass 1 Multiplier to 1
      • Pass 2 Multiplier to 1,5
      • Pass 3 Multiplier to 1,9
      • Pass 4 Multiplier to 1,7
      You use these properties to set weights for the Vertical Bloom 1, Vertical Bloom 2, Vertical Bloom 3, and Vertical Bloom 4 render passes, which the Blit Combined Bloom renders.
      You can experiment with different multiplier values to see how each pass of the bloom effect affects the final outcome.
  4. In the Preview click and drag the car to see how the bloom effect looks when the car rotates.


< PREVIOUS STEP

What's next?

In this tutorial you learned how to use render passes and shaders to apply a bloom effect on 3D content.

Now you can:

See also

To learn more about the render passes in Kanzi, see Rendering.